/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodeparsers.tools;

import org.openide.util.Lookup;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;
import pl.edu.amu.wmi.kino.visualjavafx.javafxcodeparsers.api.Parser;

/**
 *
 * @author Admin
 */
public class LocalLookupInitializer {
    public static AbstractLookup getMyLocalLookup(Class c){
        InstanceContent lookupContent = new InstanceContent();
        Lookup.Result<Parser> parsers =  Lookup.getDefault().lookupResult(Parser.class);
         for(Parser p : parsers.allInstances()){
             if(p.getProperContext(c))
                 lookupContent.add(p);
         }
         return new AbstractLookup(lookupContent);
    }
}
